import { Node, Prefab, instantiate } from 'cc';
import { UIModuleEnum } from './enum/UIDefine';
import { GameSceneView } from './game/GameSceneView';
import { MainMenu } from './game/MainMenu';
import { BaseUIView } from './game/base/BaseUIView';
import { LayerManager } from './manager/LayerManager';
export class Main extends BaseUIView {
    private _container:Node;
	private _mainMenu:MainMenu;
    private _gameScene:GameSceneView;
	public constructor(){
		super(UIModuleEnum.main,"Main");
	}

	protected get parent(){
        return LayerManager.mainLayer;
    }

    protected initUI(): void {
        this._container = this.getChildByName("Container");
        this.getModuleRes("GameSceneView",(prefab:Prefab)=>{
            let node = instantiate(prefab);
            this._container.addChild(node);
            this._gameScene = node.getComponent(GameSceneView);
        });
        this._mainMenu = new MainMenu(this.getChildByName("Menu"));
    }

	protected initEvent(){
        
	}

	public onShowAfter(){
	}
}


